<template>
	<view class="file-content">
		<z-paging ref="paging" v-model="data.list" @query="getList">
			<!-- <u-list> -->
				<view class="fileList">
					<view class="fileitem" v-for="(item, index) in data.list" :key="index">
						<view class="item">
							<image class="icon" mode="aspectFit" src="../../static/images/file-paste.png" alt=""></image>
							<view class="info" @click="policyPreview(item)">
								<view class="title">{{ item.file.org_name }}</view>
								<view class="size">{{ item.file.size_format }}M</view>
							</view>
						</view>
						<!--						<u-icon @click="goNav('/pages/contract/fileSign?id='+item.id)" name="edit-pen-fill"-->
						<!--							color="#3c9cff" size="30"></u-icon>-->
					</view>
				</view>
			<!-- </u-list> -->
		</z-paging>
	</view>
</template>
<script setup>
	import {
		fileSignList
	} from "@/api/module/contract.js";
	import {
		ref,
		reactive
	} from "vue"
	import {
		msg,
		goNav
	} from "@/utils/common";
	import {
		previewfile,
	} from "@/utils/article/fileRead";
	import {
		onShow,
		onLoad
	} from "@dcloudio/uni-app";
	const paging = ref(null)
	const data = reactive({
		list: []
	});
	const policyPreview = (info) => {
		previewfile(info.file.pdf_url ? info.file.pdf_url : info.file.path_url)
	}
	//获取列表
	const getList = (pageNo, pageSize) => {
		const params = reactive({
			page: pageNo || 1,
			limit: pageSize || 10,
		});
		fileSignList(params).then(res => {
			paging.value.complete(res.data);
		})
	}
	//触底加载
	const scrolltolower = () => {
		console.log('触底加载...')
	}
	onShow(() => {
		if (paging.value?.reload) {
			paging.value.reload();
		}
	})
</script>
<style lang="less" scoped src="/static/css/my/file.scss"></style>